<?php
/**
 * 协会会员分类列表
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package 古槐乡情
 * @subpackage 2017-01
 * @since 1.0
 * @version 1.0
 */
get_header(); 
?>
<link rel="stylesheet" href="<?php autoVer(bloginfo('template_url').'/css/ulli.css');?>" type="text/css">
<div class="row">
    <div class="col-md-8">
        <div class="panel hlgd-title">
            <?php 
                $sticky = get_option('sticky_posts');
                $args = array(
                    'post__in'  => $sticky,
                    'meta_key' => 'sort',
                    'orderby' => 'meta_value'
                );
                $the_query = new WP_Query($args);
             ?>
            <div class="panel-heading">名家推荐</div>
            <hr>
            <div class="panel-body imgteaser">
                <?php 
                if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post(); ?>
                            <div class="col-xs-2 col-md-2 photoa">
                            <a target="_blank" href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
                                <?php the_post_thumbnail(array(143,143) );?>
                                <div class="bwidt">
                                    <span class="stxt">
                                        <?php echo wp_trim_words(get_the_title(),14); ?>
                                    </span>
                                </div>
                            </a>
                            </div>
                <?php endwhile;?>
                <?php else: ?>
                    <div class="post"><p>文章稍后更新</p></div>
                <?php endif; ?>
            </div>
        </div>
    
        <div class="panel hlgd-title">
            <?php 
                query_posts(array(
                    'post__not_in'  => $sticky,
                    'meta_key' => 'sort',
                    'orderby' => 'meta_value'
                    )
                );
            ?>
            <div class="panel-heading">协会名家</div>
            <hr>
            <div class="panel-body imgteaser">
                <ul class="list_number">
                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                    <?php if(!is_sticky()){?>
                        <div class="col-xs-2 col-md-2 photoa">
                            <a target="_blank" href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
                                <?php the_post_thumbnail(array(143,143) );?>
                                <div class="bwidt">
                                    <span class="stxt">
                                        <?php echo wp_trim_words(get_the_title(),14); ?>
                                    </span>
                                </div>
                            </a>
                            </div>
                <?php } endwhile;?>
                <?php else: ?>
                    <div class="post"><p>文章稍后更新</p></div>
                <?php endif; ?>
                </ul>
            </div>
            <?php wp_pagenavi(); ?>
        </div>
    </div>
    <div class="col-md-3">
        <?php get_sidebar(); ?>
    </div>
</div>
<?php get_footer(); ?>
